Skip to main content

WebSocketLog

WebSocketLog

The WebSocketLog component is a React component that displays a log of messages received from a WebSocket server. It uses the useSelector hook from react-redux to access the messages from the Redux store.

Usage

import WebSocketLog from './WebSocketLog';

const MyComponent = () => {
return (
<div>
<WebSocketLog />
{/* Other content */}
</div>
);
};

Props

This component does not accept any props.

Styling

The component uses inline styles to set the font size of the message list. This style can be modified to customize the appearance of the log.

Notes

  • This component requires the websocket reducer to be set up in the Redux store.
  • The websocket reducer should contain an array of WebsocketMessage objects, each with a createdDate, type, user, and payload property.